<?php
class mail{
	public static function run($title,$body,$toemail,$formemail,$clientname){
		k::import( 'plugin.phpmailer');
		$mail = new PHPMailer();
		$mail->CharSet = "gb2312";  //设置采用gb2312中文编码
		$mail->IsSMTP();                    //设置采用SMTP方式发送邮件
		$mail->Host = "mail.chinatravelguide.com.cn";    //设置邮件服务器的地址 //mail.chinatravelguide.com.cn
		$mail->Port = 25;                           //设置邮件服务器的端口，默认为25
		$mail->From     = "contact@chinatravelguide.com.cn";  //设置发件人的邮箱地址
		$mail->FromName = "chinatravelguide";                       //设置发件人的姓名
		$mail->SMTPAuth = true;                                    //设置SMTP是否需要密码验证，true表示需要
		$mail->Username="contact@chinatravelguide.com.cn";
		$mail->Password = "3990977";
		$mail->Subject = $title;                                 //设置邮件的标题
		$mail->AltBody = "text/html";                                // optional, comment out and test
		$mail->Body = $body;  
		$mail->IsHTML(true);                                        //设置内容是否为html类型
		//$mail->SMTPDebug = true;
		//$mail->WordWrap = 50;                                 //设置每行的字符数
		$mail->AddReplyTo($formemail,$clientname);     //设置回复的收件人的地址
		 $mail->AddAddress($toemail);     //设置收件的地址
		 return $mail->Send();
	}
}
?>